package com.czy.fx.day1.pane.gridPane;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;

public class demo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("标题");
        primaryStage.setWidth(800);
        primaryStage.setHeight(800);
        Button b1 = new Button("b1");
        Button b2 = new Button("b2");
        Button b3 = new Button("b3");
        Button b4 = new Button("b4");
        Button b5 = new Button("b5");
        Button b6 = new Button("b6");
        Button b7 = new Button("b7");
        Button b8 = new Button("b8");
        Button b9 = new Button("b9");
        Button b10 = new Button("b10");
        Button b11 = new Button("b11");
        Button b12 = new Button("b12");

        GridPane gridPane = new GridPane();
        gridPane.add(b1, 0, 0, 1, 1);
        gridPane.add(b2, 0, 1, 1, 1);
        gridPane.add(b3, 0, 2, 1, 1);
        gridPane.add(b4, 1, 0, 1, 1);
        gridPane.add(b5, 1, 1, 1, 1);
        gridPane.add(b6, 1, 2, 1, 1);
        gridPane.add(b7, 2, 0, 1, 1);
        gridPane.add(b8, 2, 1, 1, 1);
        gridPane.add(b9, 2, 2, 1, 1);
        gridPane.add(b10, 3, 0, 1, 1);
        gridPane.add(b11, 3, 1, 1, 1);
        gridPane.add(b12, 3, 2, 1, 1);

        primaryStage.setScene(new Scene(gridPane));

        primaryStage.show();
    }
}
